import * as React from 'react';
import { Router, Route, IndexRoute } from 'dva/router';
import rts from './routes';
const { App, Login, Error, Dashboard, User } = rts;

export const routes = (
    <Route path="/" component={App} >
      <Route path="login" component={Login} />
      <Route path="dashboard" component={Dashboard} />
      <Route path="user" component={User} />
      <Route path="*" component={Error} />
    </Route>
);

export default function({ history }) {
  return (
    <Router history={history}>
      { routes }
    </Router>
  );
}
